using Microsoft.Xna.Framework;
using SCSEngine.ScreenManagement.Implement.EntityImplement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SCSEngine.Utils.Entities.Process.EntityKiller
{
    public class EntityKillerProcessManager : BaseGameProcessManager
    {
        private IEntityManager entityManager;

        public EntityKillerProcessManager(IEntityManager entityManager)
        {
            this.entityManager = entityManager;
            this.Priority = float.MaxValue;
        }

        protected override bool IsValidProcess(object process)
        {
            return process is IKillEntityProcess;
        }

        public override void Run(Game game, GameTime gameTime)
        {
            foreach (IKillEntityProcess entityKiller in this.Processes)
            {
                entityKiller.CheckKillEntity(this.entityManager);
            }
        }

        public override bool IsDrawProcess
        {
            get { return false; }
        }

        public override Type ProcessType
        {
            get { return typeof(IKillEntityProcess); }
        }
    }
}
